package com.jianggy.proxy.jdk1;

import java.lang.reflect.Proxy;

public class ProxyFactory<T> {
	private T targetObject;

	public ProxyFactory(T targetObject) {
		this.targetObject = targetObject;
	}

	public T getProxy() {
		T res = (T) Proxy.newProxyInstance(targetObject.getClass().getClassLoader(),
				targetObject.getClass().getInterfaces(), new DaoProxyHandler(targetObject));
		return res;
	}

}
